// 计算签名函数
import crypto from "crypto";

function calculateSign(secret: string, timestamp: string): string {
    const stringToSign = `${timestamp}@${secret}`; // 拼接字符串
    const hmacCode: Buffer = crypto
        .createHmac("sha256", stringToSign)
        .update("")
        .digest();
    return hmacCode.toString("base64"); // 返回 Base64 编码后的签名
}

export default calculateSign;